package com.gdpa.service.impl;

import com.gdpa.entity.DistrArea;
import com.gdpa.mapper.DistrAreaMapper;
import com.gdpa.service.IDistrAreaService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 分销区域表 服务实现类
 * </p>
 *
 * @author zsr
 * @since 2018-12-19
 */
@Service
public class DistrAreaServiceImpl extends ServiceImpl<DistrAreaMapper, DistrArea> implements IDistrAreaService {
    @Autowired
    DistrAreaMapper distrAreaMapper;

    @Override
    public boolean AreaIsExist(String area) {
        DistrArea distrArea = distrAreaMapper.AreaIsExist(area);
        if(distrArea != null){
            return true;
        }
        return false;
    }

    @Override
    public void addArea(String area) {
        distrAreaMapper.addArea(area);
    }

    @Override
    public List<DistrArea> findArea(String area) {
        return distrAreaMapper.fingArea(area);
    }

    @Override
    public Integer deleteArea(String area) {
        return distrAreaMapper.deleteArea(area);
    }

    @Override
    public Integer updateArea(String area, String old) {
        return distrAreaMapper.updateArea(area,old);
    }
}
